import request from "@/utils/request";

// 查询车辆基础信息列表
export function listCars(query) {
  return request({
    url: "/service/cars/list",
    method: "get",
    params: query,
  });
}

// 查询车辆基础信息详细
export function getCars(id) {
  return request({
    url: "/service/cars/" + id,
    method: "get",
  });
}

// 新增车辆基础信息
export function addCars(data) {
  return request({
    url: "/service/cars",
    method: "post",
    data: data,
  });
}

// 修改车辆基础信息
export function updateCars(data) {
  return request({
    url: "/service/cars",
    method: "put",
    data: data,
  });
}

// 删除车辆基础信息
export function delCars(id) {
  return request({
    url: "/service/cars/" + id,
    method: "delete",
  });
}
export function bindCars(cardId, driverId) {
  return request({
    url: `/service/cars/${cardId}/bind/${driverId}`,
    method: "post",
  });
}
export function unBindCars(cardId) {
  return request({
    url: `/service/cars/${cardId}/unbind`,
    method: "post",
  });
}
